package com.deer.wms.common.utils;

public class ComPrintFunc {

    public static String getMethodName() {
        StackTraceElement[] stacktrace = Thread.currentThread().getStackTrace();
        StackTraceElement e = stacktrace[stacktrace.length - 1];
        return e.getMethodName();
    }

    public static int getLineNo() {
        StackTraceElement[] stacktrace = Thread.currentThread().getStackTrace();
        StackTraceElement e = stacktrace[stacktrace.length - 1];
        return e.getLineNumber();
    }

    public static String getFileName() {
        StackTraceElement[] stacktrace = Thread.currentThread().getStackTrace();
        StackTraceElement e = stacktrace[stacktrace.length - 1];
        return e.getFileName();

    }

    public static void printCurrent(){
        System.out.println(getFileName() + ":" + getMethodName() + ":" );
    }
}
